home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 July / 1984-07.d64 / bonk barrels_vic (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  94 lines

  1. 12 print"[147]"
  2. 13 goto33
  3. 14 rem man jumps
  4. 15 pokee%,39:gosub19:pokee%,37:pokes,p:p=p+3:pokee%,38:gosub19
  5. 16 ifpeek(e%-22)=llthen77
  6. 17 pokee%,32:e%=e%-22:pokee%,38:pokes,0:pokee%,32:e%=e%-22:pokee%,38:return
  7. 18 rem move barrels
  8. 19 pokes,o
  9. 20 forx=1toz%:pokeb%(x),c
  10. 21 ifpeek(b%(x)+i%)=wthenb%(x)=b%(x)+d(x)
  11. 22 ifpeek(b%(x))=wthenb%(x)=b%(x)-t%*d(x)
  12. 23 ifpeek(b%(x)+i%)<>wthenb%(x)=b%(x)+i%
  13. 24 ifpeek(b%(x))>36andpeek(b%(x))<40then77
  14. 25 pokeb%(x),ll
  15. 26 ifb%(x)>jthengosub29
  16. 27 nextx:return
  17. 28 rem reset barrels
  18. 29 forx=1toz%:pokeb%(x),c:b%(x)=sr+int(rnd(x)*t%):nextx
  19. 30 rem ? score
  20. 31 print"";spc(242);spc(244);"score    [157][157][157][157]"sc;"         [157][157][157][157][157][157]";
  21. 32 forq=3toa+1step-1:print"[146]%";:next:print"":return
  22. 33 sr=7681:k=38400-sr+1
  23. 34 poke36879,14
  24. 35 poke36869,255
  25. 36 bl$="[158]                      "
  26. 37 al$= "[146][156]$$$$$$$$$$$$$$$$$$$$$$"
  27. 38 j=sr+449:v=36878:s=36876
  28. 39 fori=7424to7424+8*8-1:reada:pokei,a:next:gosub91
  29. 40 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,108,206,174,234,230,108,56:rem barrel
  30. 41 data56,108,246,250,134,222,108,56:rem barrel
  31. 42 data255,153,189,153,255,0,0,0:rem beam
  32. 43 data56,56,16,56,84,16,56,40:rem man normal
  33. 44 data186,186,84,56,16,16,56,40,0,0,0,56,56,16,124,170:rem man stretching,squating
  34. 45 print"[147]":a=0:sc=0:z%=4
  35. 46 rem set up screen
  36. 47 print"";:bl=60
  37. 48 fori=1to10:printbl$;al$;:next:printbl$;bl$;""
  38. 49 x=sr+21:pokev,15
  39. 50 forb=1tobl
  40. 51 r=int(rnd(x)*454)
  41. 52 pokex+r,32:pokes-1,195+b:pokex+r+k,7:nextb
  42. 53 forg=-1to20step1
  43. 54 pokex+g*22,36:pokes-1,200+(g*2):pokex+g*22+k,5
  44. 55 pokex+21+(g*22),36:pokes-1,0:pokex+21+(g*22)+k,5:nextg
  45. 56 rem prep for loop
  46. 57 e%=j:d(1)=1:d(2)=-1:d(3)=1:d(4)=-1:l=1:lm=17:rm=18:up=47:bm=39
  47. 58 o=0:w=36:c=32:kb=197:t%=20:i%=22:ll=34:d=37:z=245:p=128:tt%=1:th%=3:gosub29
  48. 59 rem main game loop
  49. 60 gosub19
  50. 61 ifpeek(e%)=llthene%=e%+22:pokee%+k,7:pokee%+i%,36:pokee%+i%+k,4:goto77
  51. 62 ifpeek(e%-i%)=llthen77
  52. 63 ifpeek(e%+i%)=llthenpokee%,c:e%=e%+44:goto77
  53. 64 ifll=34thenll=35:goto66
  54. 65 ll=34
  55. 66 pokee%,c
  56. 67 ifpeek(kb)=lmthenifpeek(e%-l)<>wthene%=e%-l:gosub110:pokee%,d:goto71
  57. 68 ifpeek(kb)=rmthenifpeek(e%+l)<>wthene%=e%+l:gosub110:pokee%,d:goto71
  58. 69 ifpeek(kb)=bmthenifpeek(e%-i%)=wthenpokee%-i%,c:sc=sc-5:p=p-10:goto71
  59. 70 ifpeek(kb)=upthenifpeek(e%-i%)<>wthengosub15:sc=sc+2*l:p=p+3:pokee%,d
  60. 71 iff=1thenf=0:goto77
  61. 72 pokee%,d:pokes,p:ifp<128or p>200thenp=128
  62. 73 if e%<srthene%=j:tt%=tt%+l:gosub31:ifsc>35thenz%=rnd(x)*4+1
  63. 74 iftt%>th%thengoto47
  64. 75 goto60
  65. 76 rem lose man
  66. 77 n=15:pokes+1,235:pokev,n:forq=1to4:pokeb%(q),32:next
  67. 78 pokee%,38:pokee%-22,34:gosub103:pokee%,37:gosub103:pokee%,39:gosub103
  68. 79 pokee%-22,194:pokee%,35:gosub103:pokee%+1,173:pokee%-1,173:pokee%+22,194
  69. 80 pokee%-21,206:pokee%-23,205:pokee%+23,205:pokee%+21,206:gosub103
  70. 81 pokee%-66,174:pokee%-2,174:pokee%+2,174:pokee%+66,174:gosub103:pokee%-42,174
  71. 82 pokee%-46,174:pokee%+42,174:pokee%+46,174:gosub103
  72. 83 poke36877,0:a=a+1:sc=sc-8:gosub31
  73. 84 tt%=1:ifa<3goto47
  74. 85 print"[147]      game over"
  75. 86 print" press p play again":print"    press e to end";
  76. 87 getyy$:ifyy$="p"then 45
  77. 88 if yy$="e" then print"[147]":poke36869,240:end
  78. 89 goto87
  79. 90 rem
  80. 91 print"[147][158]*instructions*"
  81. 92 print"a is left":print"d is right":print"f3 is up"
  82. 93 print"f1 will blast            space above "
  83. 94 print"2 for each up":print"-5 for using blast"
  84. 95 print"-8 for getting hit"
  85. 96 print "press space bar[159]"
  86. 97 ifpeek(197)<>32then97
  87. 100 return
  88. 102 rem time and sound for lose man routine
  89. 103 n=n-2:ifn<0thenn=0
  90. 104 pokev,n:ifpeek(e%)=38orpeek(e%)=39thenforq=1to200:next
  91. 105 forq=1to50:next:return
  92. 110 ifpeek(e%)<>34andpeek(e%)<>35thenreturn
  93. 111 f=1:return
  94.